<template>
 <div style="padding: 20px;">
    <h1>欢迎来到首页 🎉</h1>
    <p>当前登录用户：{{ user?.name }}</p>
    <el-button @click="logout">退出登录</el-button>
  </div>
  <main>
    <TheWelcome />
  </main>
</template>

<script setup lang="ts">
import TheWelcome from '../components/TheWelcome.vue'
import { computed } from 'vue'
import { useAuthStore } from '../stores/authStore'

const authStore = useAuthStore()
const user = computed(() => authStore.user)

const logout = () => {
  authStore.logout()
}
</script>
